473,419 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

Drop-Down/Text Box Combination?

I am a javascript newbie and did not see anything quite like this in
sections 1-5 of the FAQ or on a Google search.

Is there a generic javascript example of a compound drop-down/text box,
i.e., if the user selects an item from the drop-down, the selected item
populates the text box, but the user can also type their own ad-hoc
value into the text box if desired?

I would like to include such a control in a php/mysql web form I am
developing.

Jul 20 '05 #1
3 20481
@SM
bonehead a ecrit :
I am a javascript newbie and did not see anything quite like this in
sections 1-5 of the FAQ or on a Google search.

Is there a generic javascript example of a compound drop-down/text box,
i.e., if the user selects an item from the drop-down, the selected item
populates the text box, but the user can also type their own ad-hoc
value into the text box if desired?
<form>
<input type=text name="truc">
<select onchange= if(this.options.selectedIndex==0)
alert('Do an other choice');
else
this.form.truc.value=this.options[this.options.selectedIndex].value;">
<option selected>Choisir une ville - Select a Town
<option value="Paris">Paris
<option value="London">Londres - London
<option value="Tokio">Tokio
</select>
</form>
I would like to include such a control in a php/mysql web form I am
developing.


???? pas ni compris - Not do unterstand - Yo no comprender
You make choice by menu
Then you can change the value of text
The php will receive the value of "truc" ( $truc )

Jul 20 '05 #2
Thanks
@SM wrote:
bonehead a ecrit :

I am a javascript newbie and did not see anything quite like this in
sections 1-5 of the FAQ or on a Google search.

Is there a generic javascript example of a compound drop-down/text box,
i.e., if the user selects an item from the drop-down, the selected item
populates the text box, but the user can also type their own ad-hoc
value into the text box if desired?

<form>
<input type=text name="truc">
<select onchange= if(this.options.selectedIndex==0)
alert('Do an other choice');
else
this.form.truc.value=this.options[this.options.selectedIndex].value;">
<option selected>Choisir une ville - Select a Town
<option value="Paris">Paris
<option value="London">Londres - London
<option value="Tokio">Tokio
</select>
</form>
I would like to include such a control in a php/mysql web form I am
developing.

???? pas ni compris - Not do unterstand - Yo no comprender
You make choice by menu
Then you can change the value of text
The php will receive the value of "truc" ( $truc )


Jul 20 '05 #3
The simple answer is there is no combo box control in HTML. There is a
SELECT element, but this lacks the text box part of the combo box. Recently
I went looking for a combo box control myself. I found two, the first is
at

http://webfx.eae.net/dhtml/combobox/combobox.htm

It seems to be really slick but it did not layout well with respect to the
rest of my form (which was laid out in a simple table).

I also found a commercial control at:

http://www.ycode.com/

which ooks to be good, but I am not interested in buying a combo box.

In the end I just hacked up a control by implementing a button -
input(text) - button combination of un-named items in a form (with a named
hidden input) holding my final value. I used an (IE specific) IFRAME
containing a table to represent the drop down menu, that could be hidden
using CSS display/visibility. I create the menu dynamically using script
(in much the same way that the webfx control does).

I strongly suggest you look at the we control as it work very well is is
very well coded.

Hope this helps.

d.
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: riehe | last post by:
Dear all I want to drop a node from a nodegroup. Can someone confirm if its enough to redistribute a node group with a partition map which doesn't include the node to be dropped? I can't see...
1
by: Ian Dobson | last post by:
Hi, I need to drop a schema from a database but it has 400 tables in it. Is there an easy way to do it other than drop table schema1.table1 drop table schema1.table2 etc.. to 400 and then drop...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
8
by: WindAndWaves | last post by:
Hi everyone, Has anyone got any experience with drop and drag in Access? I would like to make a calendar style form where my users can drop and drag appointments.... I am using Access 2003...
5
by: Markus | last post by:
I tried this: ALTER TABLE Dokumente DROP COLUMN docPrioID but I get this errormessage: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: COLUMN;ABLE Dokumente DROP;CONSTRAINT
1
by: Darren | last post by:
I'm trying to create a file using drag and drop. I want to be able to select a listview item drag it to the shell and create a file. Each icon in the listview represents a blob in a database. When...
0
by: RHSFSS | last post by:
Hi, I have a Drag and Drop registration problem (See http://www.thescripts.com/forum/thread434707.html for similar problem post), can anyone out thereadvise on the best solution? I have a .NET 2.0 ...
4
by: pagelogix | last post by:
I'm looking for a way to drop multple tables at the same time from my access database. Any ideas? Thanks.
15
by: uwcssa | last post by:
I try to drop a table as: I got: During SQL processing it returned: SQL0478N The object type "TABLE" cannot be dropped because there is an object "sch.SQL070515104729271", of type "FUNCTION",...
5
by: sreemati | last post by:
Hi I am working on SQL SERVER 200 and I am trying to drop the default constraints set in few tables. I tired to follow the instructions given in MSDN for dropping a default: 1) Unbind the code...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.